import './TodoList.scss'
import Top from './top'
import Bottom from './bottom';
import { useState } from 'react';


const TodoList = () => {

    const [data, setData] = useState({
        data: [
            {
                headline: "123",
                date: "123",
                priority: "231"
            }
        ]
    })
    const add = (e) => {
        console.log(e);
        let List = data.data
        List.push(e)
        setData({ data: List })
    }
    return (
        <>
            <div className='TodoList'>
                <div>
                    <Top add={add}></Top>
                </div>
                <div>
                    <Bottom data={data} ></Bottom>
                </div>
            </div>
        </>
    );
};
export default TodoList;